Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDocument


CreateDraft

Document Shell

The CreateDraft method creates a new most recent draft object in this document.

ODDraft CreateDraft (in ODDraft below, 
                     in ODBoolean releaseBelow);
below
A reference to the most recent draft for this document.
releaseBelow
kODTrue if the below draft should be released, otherwise kODFalse.
return value
A reference to the newly created draft object with exclusive read/write permissions.
DISCUSSION
This method creates, initializes, and returns a new draft object, which is the most recent draft of this document. (To create the base draft of the document, the document shell calls the AcquireBaseDraft method instead.)

If the releaseBelow parameter is true, this document removes its reference to the below draft by calling that draft's Release method.

This method initializes the reference count of the returned draft. When the caller has finished using that draft, it should call the draft's Release method.

EXCEPTIONS
kODErrInvalidBelowDraft
The document has previous drafts and the below draft is not the most recent draft of the document.
kODErrInvalidPermissions
The below draft has exclusive read/write permissions, and the releaseBelow parameter is false; this combination is illegal because only the most recent draft can have write permission.
SEE ALSO
The ODDocument::AcquireDraft method (page 136).
The ODContainer::AcquireDocument method (page 100).
The ODRefCntObject::Release method (page 577).
The ODDraft class (page 147).
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help